package edu.xjtu.jih.showDemands;

import org.apache.ibatis.session.SqlSession;
import edu.xjtu.jih.common.Utils;

import java.util.List;

public class ShowDemandsService {
    SqlSession sess = Utils.openSession();
    ShowDemandsDao dao = sess.getMapper(ShowDemandsDao.class);

    public List<ShowDemandsDto> getDemandsInfo() {

        try {
            List<ShowDemandsDto> demandsInfoList = dao.selectDemands();
            return demandsInfoList;
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }

    /*public List<ShowDemandsDto> getDemandsInfoByLabel(String label) {

        try {
            System.out.println(0);
            List<ShowDemandsDto> demandsInfoList = dao.selectDemandsByLabel(label);
            System.out.println(1);
            return demandsInfoList;
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }*/
}
